import { Router } from "express";
import { IcallbackFn, Ioracle } from "../../types";

export default (router:Router,oracle:Ioracle,callbackFn:IcallbackFn) => {

  //抓取管理员
  router.post("/getManageData",(_req,res) => {
    let sql = " select distinct substr(b.asset_dept,1,2) asset_org,b.group_dept "
    sql += " ,b.asset_dept,substr(a.dept,1,2) org_code,a.dept dept_code "
    sql += " ,a.work_num,a.chinese_name,b.expense_account,b.rowid row_id "
    sql += " from user_info_n a,xx_assetmove_deptgroup b "
    sql += " where 1 = 1 "
    sql += " and a.job_status='employed' "
    sql += " and a.attribute1 = b.group_dept "
    callbackFn(res,oracle.connChaos,{sql})
  })

  //新增管理员
  // router.post("/insertManageData",(req,res) => {
  //   const {} = req.body
  //   let sql = " "
  //   callbackFn(sql,res,oracle.connChaos)
  // })

  // //删除管理员
  // router.post("/deleteManageData",(req,res) => {
  //   const {} = req.body
  //   let sql = ""
  //   callbackFn(sql,res,oracle.connChaos)
  // })

  return router

}